package com.test;

import java.util.Scanner;

public class PassSeven {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int end = sc.nextInt();
        for (int i = 0; i <= end; i++) {
            if (i % 7 == 0 || (i % 10) == 7 || (i / 10 % 10) == 7) {
                System.out.println("过");
                continue;
            }
            System.out.println(i);
        }
    }
}
